import { createSlice ,createAsyncThunk} from "@reduxjs/toolkit"




 const countSlice = createSlice({
    name:"counter",
    initialState:{
        count:0
    },
    reducers:{
        increment:(prev,{payload})=>{
            prev.count+=payload
        },
        decrement:(prev,{payload})=>{
            prev.count-=payload
        }
    },
    extraReducers:{
        // [waitIncrement.fulfilled](prev,{payload}){
        //     prev.count+=payload
        // }
    }
})

export const {increment,decrement}=countSlice.actions

export default countSlice.reducer